Page({
  data: {
    taskVisible: false,
    taskList: [
      {
        title: '新人专享',
        list: [
          { icon: '', name: '收藏人人租机小程序', isGet: true, coin: 20, link: 'index'},
          { icon: '', name: '进行实名认证', isGet: false, coin: 30, link: 'index'},
        ]
      },
      {
        title: '每天逛逛',
        list: [
          { icon: '', name: '逛一逛活动页', isGet: false, coin: 10, link: 'index'},
          { icon: '', name: '逛一逛首页', isGet: false, coin: 10, link: 'index'},
          { icon: '', name: '逛一逛生活号首页', isGet: false, coin: 10, link: 'mall'},
          { icon: '', name: '去分享', isGet: false, coin: 5, link: 'message'},
        ]
      }
    ],
    showCoinTip: false,
    coinData: {
      coin: 20,
      title: "任务完成",
    }
  },
  onLoad() {
    this.showPopup()
  },
  close() {
    this.setData({
      taskVisible: false
    })
  },

  showPopup() {
    this.setData({
      taskVisible: true,
      showCoinTip: true,
    })
    setTimeout(() => {
      this.setData({
        showCoinTip: false,
      });
    }, 2000);
  }
});
